﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>快速输入</title>
    <script language="JavaScript" src="../../../Comm/JScript.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>
    <script type="text/javascript" language="javascript">
        //页面启动函数.
        $(function () {

            $("#Msg").html("正在加载,请稍后......");

            //组织主键, 
            var mypk = "FastInput_" + GetQueryString("FK_MapData") + "_" + GetQueryString("KeyOfEn");
            var en = new Entity("BP.Sys.MapExt");
            en.MyPK = mypk;
            var num = en.RetrieveFromDBSources(); //执行查询..

            if (num == 1) {
                document.getElementById("Btn_Delete").disabled = true;
            }

            document.getElementById("TB_Doc").value = en.Doc;
            document.getElementById("DDL_Tag1").value = en.Tag1;
            $("#Msg").html("");

        });

        //装载模版.
        function LoadTemplate() {
            var url = "../../SettingTemplate.htm?TemplateType=FastInput";
            WinOpen(url, 'ss');
        }

        function Save() {

            var doc = $("#TB_Doc").val();
            if (doc == null || doc == undefined || doc == "") {
                alert("请输入内容.");
                return;
            }

            doc = doc.replace("'", "~");

            $("#Msg").html("正在保存,请稍后......");

            //组织主键, 
            var mypk = "FastInput_" + GetQueryString("FK_MapData") + "_" + GetQueryString("KeyOfEn");
            var en = new Entity("BP.Sys.MapExt");
            en.MyPK = mypk;
            en.RetrieveFromDBSources();

            en.SetValByKey("FK_MapData", GetQueryString("FK_MapData"));
            en.SetValByKey("AttrOfOper", GetQueryString("KeyOfEn"));
            en.SetValByKey("ExtType", "FastInput");
            en.SetValByKey("Doc", doc);
            en.SetValByKey("Tag1", $("#DDL_Tag1").val());
            en.Save();

            window.location.href = window.location.href;
        }

        function Delete() {

            if (window.confirm('您确定要删除吗？') == false)
                return false;

            //组织主键, 
            var mypk = "FastInput_" + GetQueryString("FK_MapData") + "_" + GetQueryString("KeyOfEn");
            var en = new Entity("BP.Sys.MapExt");
            en.MyPK = mypk;
            en.Delete(); //执行删除.

            window.location.href = window.location.href;
        }
    </script>
</head>
<body>
    <form id="cc">

  
        <table id="table" style="width: 98%;">
    <caption>快速输入 </caption>

            <tr>
                <td colspan="3">
                    快速输入内容，多行用@分开。
                </td>
            </tr>

            <tr>
                <td colspan="3" style="width: 100%;">
                    <textarea rows="4" name="TB_Doc" id="TB_Doc"> </textarea>
                </td>
            </tr>

              <tr>
                <td colspan="2">
                    历史词汇启用字段
                </td>
               <td><select id="DDL_Tag1" value="0"> <option value="0" >不启用</option><option value="1">启用</option> </select> </td>
            </tr>
        </table>
            <input type="button" value="保存" onclick="Save()" id="Btn_Save" />
                    <input type="button" value="删除" onclick="Delete()" id="Btn_Delete" />

                    <fieldset>
                    <legend>帮助</legend>
                    <ul>
                    <li>快速录入是为了解决重复数据相同内容的填写.</li>
                    <li>能够减轻输入人员的劳动，并大幅度提高使用体验。</li>
                    <li><a href="FastInput.png" target=_blank > <img src="FastInput.png" style="width:400px;"  border=0/> </a> </li>

                    </ul>
                    </fieldset>

    <div id="Msg">
    </div>
    </form>
</body>
</html>
